export default () => {
	function isExternal(path) {
		return /^(https?:|mailto:|tel:)/.test(path);
	}
	function removeGlobalLoading() {
		const loadingBg = document.querySelector("#loading-bg");
		if (loadingBg) {
			// @ts-ignore
			loadingBg.style.display = "none";
		}
	}

	function addGlobalLoading() {
		const loadingBg = document.querySelector("#loading-bg");
		if (loadingBg) {
			// @ts-ignore
			loadingBg.style.display = "block";
		}
	}
	return { isExternal, removeGlobalLoading, addGlobalLoading };
};
